#include "Ray.h"

void Ray_t::Init( SD_Tools::Vector& start, SD_Tools::Vector& end )
{
	/*m_Delta = SD_Tools::MathHelper::SubVector(start, end);

	m_IsSwept = (m_Delta.MagnitudeSqr() != 0.0f);

		
	m_Extents.Clear();
	m_IsRay = true;

	// Offset m_Start to be in the center of the box...
	m_StartOffset.Clear();
	m_Start = start;*/

	//m_Delta.x = start.x - end.x;
	//m_Delta.y = start.y - end.y;
	//m_Delta.z = start.z - end.z;

	m_Delta.x = end.x - start.x;
	m_Delta.y = end.y - start.y;
	m_Delta.z = end.z - start.z;
	m_Delta.w = 0.0f;

	m_IsSwept = (((m_Delta.x*m_Delta.x)+(m_Delta.y*m_Delta.y)+(m_Delta.z*m_Delta.z)) != 0.0f);
	m_Extents.x = m_Extents.y = m_Extents.z = m_Extents.w = 0.0f;

	m_IsRay = true;

	m_StartOffset.x = m_StartOffset.y = m_StartOffset.z = m_StartOffset.w = 0.0f;
	m_Start.x = start.x;
	m_Start.y = start.y;
	m_Start.z = start.z;
	m_Start.w = 0.0f;
}